/*
 * 		Timer.h
 *
 *		Time between frames and FPS
 *
 *		Inherits from Model3D (position and possibly texture loading)
 *		and GL_Writer (writing text - FPS to screen)
 *
 ****************************************************************
 *
 *		getTime:	time since last call
 *		renderGL:	prints FPS on model x,y coordinates (integer - orto perspective)
 *					printf style of variable arguments
 *		initializeGL:	build font, required on every window create
 *
 ****************************************************************/

#ifndef TIMER_H_
#define TIMER_H_

#include "Model3D.h"
#include "GL_Writer.h"

class Timer : public Model3D, public GL_Writer  {
public:
	Timer();
	virtual ~Timer();

	float getTime();
	void renderGL();
	void initializeGL();

private:
	bool performanceTimer;					// If QueryPerformanceCounter supported
	float resolution;
	long long frequency;

	float deltaTime;						// Temp variable to return miliseconds since last call
	long long time;
    long long lastTime;

	float fps;
    float fpsTime;							// Time since last FPS update
    int frameCount;
};

#endif /* TIMER_H_ */
